package com.malie.myspringboot.designPattern.factory;

public class ShareFactory {
    public Share getShare(String user) {
        if (user == null) {
            return null;
        }
        if (user.equalsIgnoreCase("user1")) {
            return new User1();
        }
        if (user.equalsIgnoreCase("user2")) {
            return new User2();
        }
        return null;
    }
}
